<?php

use yii\helpers\Html;
use yii\widgets\DetailView;

/* @var $this yii\web\View */
/* @var $model app\models\MOrder */

$this->title = $model->title;
$this->params['breadcrumbs'][] = ['label' => '订单管理', 'url' => ['index', 'userid' => $model->userid]];
$this->params['breadcrumbs'][] = $this->title;
?>

<style>

    .my_h3 {
        background-color: #f5f5f5;;
        border-radius: 5px;
        height: 40px;
        line-height: 1.6;
    }

</style>

<div class="morder-view">

    <!--
    <h3><//?= Html::encode($this->title) ?></h3>
    -->

    <!--
    <p>
        <//?= Html::a('修改', ['update', 'id' => $model->order_id], ['class' => 'btn btn-primary']) ?>
        <//?= Html::a('删除', ['delete', 'id' => $model->order_id], [
            'class' => 'btn btn-danger',
            'data' => [
                'confirm' => 'Are you sure you want to delete this item?',
                'method' => 'post',
            ],
        ]) ?>
    </p>
    -->

    <?php
        $goods = \app\models\MGoods::findOne(['goods_id' => $model->goods_id]);
    ?>


    <div>

        <!-- Nav tabs -->
        <ul class="nav nav-tabs" role="tablist">
            <li role="presentation" class="active"><a href="#jbxx" aria-controls="jbxx" role="tab" data-toggle="tab">基本信息</a></li>
            <li role="presentation"><a href="#mjxx" aria-controls="mjxx" role="tab" data-toggle="tab">买家信息</a></li>
            <li role="presentation"><a href="#fbrxx" aria-controls="fbrxx" role="tab" data-toggle="tab">发布人信息</a></li>
            <li role="presentation"><a href="#shrxx" aria-controls="shrxx" role="tab" data-toggle="tab">收货人信息</a></li>
            <li role="presentation"><a href="#kpxx" aria-controls="kpxx" role="tab" data-toggle="tab">开票信息</a></li>
            <li role="presentation"><a href="#wlxx" aria-controls="wlxx" role="tab" data-toggle="tab">物流信息</a></li>
            <li role="presentation"><a href="#kfxx" aria-controls="kfxx" role="tab" data-toggle="tab">客服信息</a></li>
        </ul>

        <!-- Tab panes -->
        <div class="tab-content">
            <div role="tabpanel" class="tab-pane active" id="jbxx">

                <h3 class="my_h3">基本信息</h3>
                <?= DetailView::widget([
                    'model' => $model,
                    'template' => '<tr><th width=30%>{label}</th><td>{value}</td></tr>',
                    'options' => ['class' => 'table detail-view'],
                    'attributes' => [

                        [
                            'label' => '商品展示',
                            'value' => '<img width=90px height=60px src=' . $goods->list_img_url . '>',
                            'format'=> 'html',
                        ],
                        //'order_id',
                        'oid',
                        //'feesum',
                        'goods_id',
                        'title',
                        'starttime',
                        'endtime',
                        //'status',
                        [
                            'label' => '订单状态',
                            'value' => $model->getStatus($model),
                            'format'=> 'html',
                        ],
                        'create_time',

                    ],
                ]) ?>

            </div>

            <div role="tabpanel" class="tab-pane" id="mjxx">

                <h3 class="my_h3">买家信息</h3>
                <?= DetailView::widget([
                    'model' => $model,
                    'template' => '<tr><th width=30%>{label}</th><td>{value}</td></tr>',
                    'options' => ['class' => 'table detail-view'],
                    'attributes' => [
                        //'userid',
                        'username',
                        'usermobile',
                        'address',
                        'memo',
                        'memo_reply',
                    ],
                ]) ?>

            </div>


            <div role="tabpanel" class="tab-pane" id="fbrxx">

                <h3 class="my_h3">发布人信息</h3>
                <?= DetailView::widget([
                    'model' => $model,
                    'template' => '<tr><th width=30%>{label}</th><td>{value}</td></tr>',
                    'options' => ['class' => 'table detail-view'],
                    'attributes' => [
                        //'receiver_name',
                        [
                            'label' => '发布人名字',
                            'value' => $model->getPubUserInfo($model,$item='name'),
                            'format'=> 'html',
                        ],
                        [
                            'label' => '发布人电话',
                            'value' => $model->getPubUserInfo($model,$item='mobile'),
                            'format'=> 'html',
                        ],

                    ],
                ]) ?>

            </div>


            <div role="tabpanel" class="tab-pane" id="shrxx">

                <h3 class="my_h3">收货人信息</h3>
                <?= DetailView::widget([
                    'model' => $model,
                    'template' => '<tr><th width=30%>{label}</th><td>{value}</td></tr>',
                    'options' => ['class' => 'table detail-view'],
                    'attributes' => [
                        'receiver_name',
                        'receiver_address',
                        'receiver_mobile',
                        'receiver_memo',
                    ],
                ]) ?>

            </div>

            <div role="tabpanel" class="tab-pane" id="kpxx">
                <h3 class="my_h3">开票信息</h3>
                <?= DetailView::widget([
                    'model' => $model,
                    'template' => '<tr><th width=30%>{label}</th><td>{value}</td></tr>',
                    'options' => ['class' => 'table detail-view'],
                    'attributes' => [
                        //'invoice_type',
                        [
                            'label' => '开票情况',
                            'value' => $model->getInvoiceType($model),
                            'format'=> 'html',
                        ],
                        'invoice_company',
                        'invoice_bank',
                        'invoice_receivernumber',
                        'invoice_address',
                        'invoice_mobile',
                        'invoice_memo',
                    ],
                ]) ?>
            </div>
            <div role="tabpanel" class="tab-pane" id="wlxx">

                <h3 class="my_h3">物流信息</h3>
                <?= DetailView::widget([
                    'model' => $model,
                    'template' => '<tr><th width=30%>{label}</th><td>{value}</td></tr>',
                    'options' => ['class' => 'table detail-view'],
                    'attributes' => [
                        'checkout_company',
                       // 'checkout_id',
                        [
                            'label' => '出库物流单号',
                            'value' => $model->getCheckoutInfo($model),
                            'format'=> 'raw',
                        ],

                        'checkin_company',
                        'checkin_id',
                    ],
                ]) ?>
            </div>
            <div role="tabpanel" class="tab-pane" id="kfxx">

                <h3 class="my_h3">客服信息</h3>
                <?= DetailView::widget([
                    'model' => $model,
                    'template' => '<tr><th width=30%>{label}</th><td>{value}</td></tr>',
                    'options' => ['class' => 'table detail-view'],
                    'attributes' => [
                        'cs_name',
                        'cs_contact',
                    ],
                ]) ?>
            </div>
        </div>

    </div>






</div>
